<template>
  <div>
    <el-card shadow="never" class="mb20">
      <classify-form ref="classifyForm" @search="handleRefresh" />
    </el-card>
    <el-card shadow="never">
      <classify-modal @refresh="handleRefresh" ref="classifyModal" />
      <el-tooltip class="item" effect="dark" content="新增项目分类" placement="top">
        <el-button
          size="small"
          type="primary"
          class="fr mb20"
          v-if="$auth('satisfaction:add')"
          @click="handleEdit(false, {})"
          icon="el-icon-plus"
        />
      </el-tooltip>
      <classify-table @edit="handleEdit" ref="classifyTable" />
    </el-card>
  </div>
</template>

<script>
import ClassifyTable from './ClassifyTable'
import ClassifyModal from './ClassifyModal'
import ClassifyForm from './ClassifyForm'

export default {
  components: {
    ClassifyTable,
    ClassifyModal,
    ClassifyForm
  },
  methods: {
    handleEdit(bool, obj) {
      this.$refs.classifyModal.edit(bool, obj)
    },
    handleRefresh(param = {}) {
      this.$refs.classifyTable.handleGetList(param)
    }
  }
}
</script>
